package com.lcf.app.basic.listener;

import com.alibaba.fastjson.JSON;
import com.lcf.app.basic.model.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author ChenFei
 * @date 2021/11/11
 */
@Slf4j
@Component
public class MyListener {

    @Async
    @EventListener
    public void userEvent(User user){
        log.info("监听到用户事件 : {}", JSON.toJSONString(user));
    }

}
